import request from "@/utils/request";

// 申请列表
export function listEmployeeApply(query) {
  return request({
    url: "/backAdmin/sysUserApplyApi/list",
    method: "get",
    params: query,
  });
}

// 员工申请详情
export function applyDetail(sysUserReplyId) {
  return request({
    url: `/backAdmin/sysUserApplyApi/detail?sysUserReplyId=${sysUserReplyId}`,
    method: "get",
  });
}

// 员工申请审核
export function applyCheck({ sysUserReplyId, status }) {
  return request({
    url: `/backAdmin/sysUserApplyApi/check?sysUserReplyId=${sysUserReplyId}&status=${status}`,
    method: "post",
  });
}

// 查询公告列表
export function listNotice(query) {
  return request({
    url: "/backAdmin/employeeApi/employee/list",
    method: "get",
    params: query,
  });
}

// 新增公告
export function addNotice(data) {
  return request({
    url: "/system/notice",
    method: "post",
    data: data,
  });
}
// 停职
export function employeeBandh({ employeeId, isBandh }) {
  return request({
    url: `/backAdmin/employeeApi/bandh?employeeId=${employeeId}&isBandh=${isBandh}`,
    method: "put",
  });
}

// 查询公告详细
export function getNotice(employeeId) {
  return request({
    // url: "/backAdmin/employeeApi/employee/detail?" + employeeId,
    url: `/backAdmin/employeeApi/employee/detail?employeeId=${employeeId}`,
    method: "get",
  });
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: "/backAdmin/employeeApi/employee",
    method: "put",
    data: data,
  });
}

// 删除公告
export function delNotice(employeeIds) {
  return request({
    url: `/backAdmin/employeeApi/employee?employeeIds=${employeeIds}`,
    method: "delete",
  });
}
